#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import os

sys.path.append('../')

from . import tp_logging
from . import tp_config

logger = tp_logging.get_logger('tp_config')

class TpException(Exception):
    """Generic exception"""
    pass

class SearxInstanceDown(TpException):
    """Searx instance not accessible exception"""

    def __str__(self):
        return (
            'Your Searx instance seems down. Try replacing it on your '
            'settings ({}).').format(tp_config.CONFIG_FILE)


class MoreThanOnePlayerRunning(TpException):
    """More than one player running exception"""

    def __str__(self):
        return 'Only a single player should be running.'
